<%--@elvariable id="myLoginId" type="java.lang.String"--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../includes/common.jsp" %>
    <title>上传测试</title>
</head>
<body>
<div>
    <form id="fileGetUp" method="post" enctype="multipart/form-data" class="form-horizontal">
        <fieldset>
            <legend></legend>
            <div class="control-group">
                <label class="control-label" for="upfile"></label>

                <div class="controls">
                    <input type="file" name="upFile" id="upFile"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label"></label>

                <div class="controls">
                    <input type="button" id="button" onclick="fileUpAttachment()" class="btn btn-primary" value="上传"/>
                </div>
            </div>
            <div>
                <input type="button" onclick="viewScorm()" value="查看上传课件"/>

            </div>
        </fieldset>
    </form>
</div>


</body>

</html>
<script type="text/javascript">
    function fileUpAttachment() {
        var upFile = document.getElementById("upFile").value;
        var fileType=upFile.indexOf(".zip",upFile.length-4);

        if(fileType==-1){
            alert("上传格式不是zip");
        }else{
            $("#fileGetUp").attr("action", basePath + "scormZip/upFile?upFile=" + upFile);
            $("#fileGetUp").submit();
        }
    }

</script>